package com.cqeec.netdisc0215;

import org.openstack4j.api.OSClient.OSClientV3;
import org.openstack4j.model.common.Identifier;
import org.openstack4j.openstack.OSFactory;

public class Test {
	public static void main(String[] args) {
		OSClientV3 os = OSFactory.builderV3().endpoint("http://192.168.126.11:5000/v3")
				.credentials("admin", "3340971686", Identifier.byName("Default"))
				.scopeToProject(Identifier.byName("admin"), Identifier.byName("Default")).authenticate();
		
		
		
		os.identity().projects().create("default", "Test", "", true);
//		System.out.println("======================");
//		System.out.println("账户信息：");
//		SwiftAccount a = os.objectStorage().account().get();
//		System.out.println(a);
//		System.out.println("账户容器信息：");
//		List<? extends SwiftContainer> clist = os.objectStorage().containers().list();
//		for (SwiftContainer sc : clist) {
//			System.out.println(sc.getName());
//			List<? extends SwiftObject> olist = os.objectStorage().objects().list(sc.getName());
//			for (SwiftObject so : olist) {
//				System.out.println((so.isDirectory() ? "目录 " : "文件 ") + "   " + so.getName());
//			}
//		}
//		System.out.println("======================");
	}

}
